package com.dhl.memento.theory;

/**
 * @title: originator
 * @Author danghailiang
 * @Date: 2022/8/22 15:58
 * @Version 1.0
 */
public class Originator {
    /**
     * 攻击力
     */
    private int atk;
    /**
     * 防御力
     */
    private int def;
    /**
     * 生命值
     */
    private int hp;
    /**
     * 蓝条
     */
    private int bp;
    private String state;

    public Originator() {
    }

    public Originator(int atk, int def, int hp, int bp, String state) {
        this.atk = atk;
        this.def = def;
        this.hp = hp;
        this.bp = bp;
        this.state = state;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento saveStateMemento(){
        return new Memento(atk, def, hp, bp ,state);
    }

    public void getStateMemento(Memento memento){
        state = memento.getState();
        atk = memento.getAtk();
        def = memento.getDef();
        hp = memento.getHp();
        bp = memento.getBp();
    }

    public int getAtk() {
        return atk;
    }

    public void setAtk(int atk) {
        this.atk = atk;
    }

    public int getDef() {
        return def;
    }

    public void setDef(int def) {
        this.def = def;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getBp() {
        return bp;
    }

    public void setBp(int bp) {
        this.bp = bp;
    }

    @Override
    public String toString() {
        return "Originator{" +
                "atk=" + atk +
                ", def=" + def +
                ", hp=" + hp +
                ", bp=" + bp +
                ", state='" + state + '\'' +
                '}';
    }
}
